<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="csrf-token" content="{{ csrf_token() }}" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="{{asset('layui-master/src/css/layui.css')}}">
    <link rel="stylesheet" href="{{asset('bootstrap/css/bootstrap.min.css')}}">
    <link rel="stylesheet" href="{{asset('css/lesson.css')}}" media="all">
</head>
<body>

<div class="layui-tab layui-tab-card box_card">
    <ul class="layui-tab-title">
        <li class="layui-this"><a href="javascript:;">课程列表</a></li>
        <li><a href="/admin/lesson/create">新增课程</a></li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <div class="layui-form">
                <table class="layui-table">
                    <colgroup>
                        <col width="150">
                        <col width="150">
                        <col width="150">
                        <col width="200">
                    </colgroup>
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>课程名称</th>
                        <th>视频数量</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($data as $dt)
                        <tr>
                            <td>{{$dt['id']}}</td>
                            <td>{{$dt['title']}}</td>
                            <td>{{$dt->videos()->count()}}</td>
                            <td>
                                <a id="edit_but" href="/admin/userManage/{{$dt['id']}}/edit">
                                    <button type="button" class="layui-btn add_style"><i class="layui-icon"></i></button>
                                </a>
                                <a id="del_but" href="javascript:;" onclick="del({{$dt['id']}})">
                                    <button type="button" class="layui-btn layui-btn-danger add_style"><i class="layui-icon"></i></button>
                                </a>
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>

        </div>
    </div>
</div>

<script type="text/javascript" src="{{asset('layui-master/src/layui.js')}}"></script>
<script type="text/javascript" src="{{asset('js/jquery-1.11.3.min.js')}}"></script>
<script type="text/javascript" src="{{asset('bootstrap/js/bootstrap.min.js')}}"></script>
</body>
</html>